From: Jo-Philipp Wich Date: Mon, 7 Aug 2023 21:33:56 +0000 (+0200) Subject: luci-base: dispatcher.uc: fix `N_()` fallback implementation X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=107ed061a8b68f080df122770690d513f52eeed0;p=project%2Fluci.git luci-base: dispatcher.uc: fix `N_()` fallback implementation The fallback implementation of `N_()` accessed the wrong variable, a global `n` instead of the local `args`. Adjust the expression to reference the correct variable. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/ucode/dispatcher.uc b/modules/luci-base/ucode/dispatcher.uc index 831922ac1d..7ff34afba9 100644 --- a/modules/luci-base/ucode/dispatcher.uc +++ b/modules/luci-base/ucode/dispatcher.uc @@ -886,7 +886,7 @@ dispatch = function(_http, path) { striptags, entityencode, _: (...args) => translate(...args) ?? args[0], - N_: (...args) => ntranslate(...args) ?? (n[0] == 1 ? n[1] : n[2]), + N_: (...args) => ntranslate(...args) ?? (args[0] == 1 ? args[1] : args[2]), }); try {